package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.FightingLogMapper;
import com.ruoyi.system.domain.FightingLog;
import com.ruoyi.system.service.IFightingLogService;
import com.ruoyi.common.core.text.Convert;

/**
 * fightingLogService业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-23
 */
@Service
public class FightingLogServiceImpl implements IFightingLogService 
{
    @Autowired
    private FightingLogMapper fightingLogMapper;

    /**
     * 查询fightingLog
     * 
     * @param userName fightingLog主键
     * @return fightingLog
     */
    @Override
    public FightingLog selectFightingLogByUserName(String userName)
    {
        return fightingLogMapper.selectFightingLogByUserName(userName);
    }

    /**
     * 查询fightingLog列表
     * 
     * @param fightingLog fightingLog
     * @return fightingLog
     */
    @Override
    public List<FightingLog> selectFightingLogList(FightingLog fightingLog)
    {
        return fightingLogMapper.selectFightingLogList(fightingLog);
    }

    /**
     * 新增fightingLog
     * 
     * @param fightingLog fightingLog
     * @return 结果
     */
    @Override
    public int insertFightingLog(FightingLog fightingLog)
    {
        fightingLog.setCreateTime(DateUtils.getNowDate());
        return fightingLogMapper.insertFightingLog(fightingLog);
    }

    /**
     * 修改fightingLog
     * 
     * @param fightingLog fightingLog
     * @return 结果
     */
    @Override
    public int updateFightingLog(FightingLog fightingLog)
    {
        return fightingLogMapper.updateFightingLog(fightingLog);
    }

    /**
     * 批量删除fightingLog
     * 
     * @param userNames 需要删除的fightingLog主键
     * @return 结果
     */
    @Override
    public int deleteFightingLogByUserNames(String userNames)
    {
        return fightingLogMapper.deleteFightingLogByUserNames(Convert.toStrArray(userNames));
    }

    /**
     * 删除fightingLog信息
     * 
     * @param userName fightingLog主键
     * @return 结果
     */
    @Override
    public int deleteFightingLogByUserName(String userName)
    {
        return fightingLogMapper.deleteFightingLogByUserName(userName);
    }
}
